<script type="text/javascript">
    //删除回调
    $('#tags').on('afterdelete.bjui.tabledit', function(e) {
        var $tbody = $(e.relatedTarget)
        console.log('你删除了一条数据，还有['+ $tbody.find('> tr').length +']条数据！')
    })
</script>
<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${ctxPath}/system/cms/tag" method="post">
        <input type="hidden" name="pageSize" value="${model.pageSize!}">
        <input type="hidden" name="pageCurrent" value="${model.pageNum!}">
        <div class="bjui-searchBar">
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <a class="btn btn-orange" href="javascript:;" onclick="$(this).navtab('reloadForm', true)" data-icon="undo">清空查询</a>&nbsp;
            <button type="button" class="btn-green" data-toggle="tableditadd" data-target="#tag" data-num="1" data-icon="plus">添加标签</button>&nbsp;
            <button type="button" class="btn-red"  data-toggle="dialog" data-url="${ctxPath}/system/cms/tag/group/list" data-maxable="false" data-resizable="false" data-width="800" data-height="600" data-id="tag-group-tab"  data-icon="plus">管理分组</button>&nbsp;
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <form id="tag_form" class="pageForm" data-toggle="validate" method="post">
        <table id="tag" class="table table-bordered table-hover table-top" data-toggle="tabledit" data-initnum="0" data-action="${ctxPath}/system/cms/tag/save" data-single-noindex="true">
            <thead>
            <tr style="text-align: center">
                <th align="center"  title="No"></th>
                <th align="center"   title="标签名称"><input type="text" name="tagName" data-rule="required"  size="5"></th>
                <th align="center"  title="分类">
                    <select name="groupId" data-toggle="selectpicker" data-rule="required">
                        @for(group in groups){
                        <option value="${group.groupId!}">${group.groupName!}</option>
                        @}
                    </select>
                </th>
                <th  align="center" title="操作" data-addtool="false" width="100">
                    <a href="javascript:;" class="btn btn-green" data-toggle="dosave">保存</a>
                </th>
            </tr>
            </thead>
            <tbody>
            @for(tag in model.list){
            <tr data-id="${tag.tagId!}">
                <td align="center" data-noedit="true">${tag.tagId!}</td>
                <td align="center">${tag.tagName!}</td>
                <td  align="center" data-val="${tag.groupId!}" ></td>
                <td  align="center"  data-noedit="true">
                    <button type="button" class="btn-green" data-toggle="doedit">编辑</button>
                    <a href="${ctxPath}/system/cms/tag/delete?ids=${tag.tagId!}" class="btn btn-red row-del" data-confirm-msg="确定要删除该行信息吗？">删</a>
                </td>
            </tr>
            @}

            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="120">120</option>
                <option value="150">150</option>
            </select>
        </div>
        <span>&nbsp;条，共 ${model.total!} 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="${model.total!}" data-page-size="30" data-page-current="1">
    </div>
</div>